using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Zosnn.Models.Mapping
{
    public class Product_InfoMap : EntityTypeConfiguration<Product_Info>
    {
        public Product_InfoMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.PicUrl1)
                .HasMaxLength(300);

            this.Property(t => t.PicUrl2)
                .HasMaxLength(300);

            this.Property(t => t.PicUrl3)
                .HasMaxLength(300);

            // Table & Column Mappings
            this.ToTable("Product_Info");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.PicUrl1).HasColumnName("PicUrl1");
            this.Property(t => t.PicUrl2).HasColumnName("PicUrl2");
            this.Property(t => t.PicUrl3).HasColumnName("PicUrl3");
            this.Property(t => t.ProductsID).HasColumnName("ProductsID");
        }
    }
}
